<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>注册页</title>
	</head>
	<link href="css/register.css" rel='stylesheet' type='text/css' />
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
	<link rel="stylesheet" href="css/style.css" type="text/css" />
	<style type="text/css">
		body{
			background: url(img/slider-2.jpg);
		}
	</style>
	<body>                  
					
					<div class="cont">
  <div class="demo">
    <div class="login">
      <div class="login__check"></div>
      <form action="" method="post" id="loginForm">
      <div class="login__form">
        <div class="login__row">
          <svg class="login__icon name svg-icon" viewBox="0 0 20 20">
            <path d="M0,20 a10,8 0 0,1 20,0z M10,0 a4,4 0 0,1 0,8 a4,4 0 0,1 0,-8" />
          </svg>
          <input type="text" class="login__input name" placeholder="Username" id="username"/>
        </div>
        <div class="login__row">
          <svg class="login__icon pass svg-icon" viewBox="0 0 20 20">
            <path d="M0,20 20,20 20,8 0,8z M10,13 10,16z M4,8 a6,8 0 0,1 12,0" />
          </svg>
          <input type="password" class="login__input pass" placeholder="Password" id="password1"/>
        </div>   
        <div class="login__row">
          <svg class="login__icon pass svg-icon" viewBox="0 0 20 20">
            <path d="M0,20 20,20 20,8 0,8z M10,13 10,16z M4,8 a6,8 0 0,1 12,0" />
          </svg>
          <input type="password" class="login__input pass" placeholder="Password" id="password2"/>
        </div>
        <input type="button" id="submit" class="login__submit submit" value="Register" onclick="Register()">
        <a href="login.html"><input type="button" class="register__submit submit" value="返回登录页"></a>
      </div>
      </form>
    </div>
</div>

<script type="text/javascript">
        function Register(){
          var Tel =document.getElementById("username").value;  
          var passWord1 =document.getElementById("password1").value;
          var passWord2 =document.getElementById("password2").value;
          var url='http://172.24.10.175/workout/api.php/reg/tel/'+Tel+'/password/'+passWord1;          
				$.ajax({    
					        type: "post",
						    url: url,
						    dataType: "jsonp",
						    jsonp: "callback",
							success: function(data){								
									alert("注册成功！");
									},error:function(){
									alert("注册成功！");	
									}
							});
					}                  	               
      </script>
	</body>
</html>
